package telsoft.app.util;

import javax.swing.*;
import javax.swing.text.*;
import telsoft.swing.MaskedDocument;

/**
 *
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2009</p>
 *
 * <p>Company: Telsoft</p>
 *
 * @author HuongNV
 * @version 1.0
 */

public class JUpperCaseDocument extends MaskedDocument
{
    public void insertString(int offs,String str,AttributeSet a) throws BadLocationException
    {

        if(str == null)
        {
            return;
        }
        char[] upper = str.toCharArray();
        for(int i = 0;i < upper.length;i++)
        {
            upper[i] = Character.toUpperCase(upper[i]);
        }
        super.insertString(offs,new String(upper),a);
    }

}
